#ifndef GLFUNCTIONS_H
#define GLFUNCTIONS_H
#include "glew.h"
#include "ZWFont.h"
#include "glm.h"
#include "ComPortHandler.h"
#include "ProgressDialog.h"
/************************************************************************/
/*This class is used to handler the graphic stuff related to OpenGL                                                                      */
/************************************************************************/
class GLHandler
{
	//don not instantiate
private:
	GLHandler();
	~GLHandler();
public:
	static bool			initGL();

	static void			initLight();

	static void			initDrawList();

	static void			setViewPort(GLsizei w, GLsizei h);

	static void			setRotateParam(float rAngle, float xR, float yR, float zR);

	//main draw function
	static void			renderScene();	

	static void			getRotateFromComHandler();

	static bool			generateGLMCallList(char* objFile, const GLfloat scale);

	static void			setComPortHandler(ComPortHandler* cpHander);

	static float		rotateAngle;
	static float		xRotate;
	static float		yRotate;
	static float		zRotate;
	static GLMmodel*	pObjModel;
	static bool			isShowCusModel;

private:
	static void			putEularInfoText();
	static void			initFont();
	static void			putFrameRateInfoText();

private:
	static ZWFontWGLBase eularInfoFont;
	static ZWFontWGLBase frameRateInfoFont;
	static ComPortHandler* pComPortHandler;
	static TimeCounter   frameTimer;
	static bool			 frameFlag;
};


#endif
